#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int arr[10000][10000] = { 0 };
int main() {
	int n;
	scanf("%d", &n);
	int turn = 1, cnt = 1;
	int i, j;
	while (cnt <= n) {
		if (turn % 2 == 1) {
			for ( i = turn - 1, j = 0; i >= 0; i--, j++) {  
				arr[i][j] = cnt;
				if (cnt++ == n) {
					printf("%d %d", i+1, j+1);
					break;
				}
			}
		}
		else {
			for ( i = 0, j = turn - 1; j >= 0; i++, j--) {
				arr[i][j] = cnt;
				if (cnt++ == n) {
					printf("%d %d", i+1, j+1);
					break;
				}
			}
			
		}
		turn++;
	}
}